/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sqlgenerators.search;

import entities.Search;
import entities.SearchProfessionalInfoRequerimentOrOperator;

/**
 *
 * @author damfercer
 */
public class ProfessionalOrSQLGenerator implements SearchSqlGeneratorInterface{
    private String res;
    @Override
    public String getSqlFromSearch(Search search) {
        res="";
//        res+=" AND(";
//        if(search.getSearchProfessionalInfoRequerimentOrOperatorList().isEmpty()){
//           res+="TRUE"; 
//        }
//        else{
//            res+="(FALSE";
//        }
//        if(!search.getSearchProfessionalInfoRequerimentOrOperatorList().isEmpty()){
//            res+=")"; 
//        }
//        for(SearchProfessionalInfoRequerimentOrOperator restriction: search.getSearchProfessionalInfoRequerimentOrOperatorList()){
//            res+=" OR(FALSE OR (TRUE";
//            res+=generateSearchProfessionalInfoRequerimentOrOperatorSQL(restriction);
//            res+="))";
//        }
//        res+=")";
        return res;
    }
    
    private String generateSearchProfessionalInfoRequerimentOrOperatorSQL(SearchProfessionalInfoRequerimentOrOperator restr){
        String result="";
//        if(restr.getSector()!=null){
//            result+=" AND candidate_professional_info.SECTOR="+restr.getSector().getIdSector();
//        }
//        if(restr.getJobPosition()!=null){
//            result+=" AND candidate_professional_info.JOB_POSITION="+restr.getJobPosition().getIdJobPosition();
//        }
//        if(restr.getMinimumJobDuration()!=null){
//            result+=" AND job_duration.VALUE >="+restr.getMinimumJobDuration().getIdJobDuration();
//        }
        return result;
    }
    
}
